package cn.kgc.vueebook.controller;
import cn.kgc.vueebook.entity.ResultEntity;
import cn.kgc.vueebook.pojo.Category;
import cn.kgc.vueebook.service.CategoryService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class CategoryController {

    @Resource
    CategoryService categoryService;

    @RequestMapping("/getCategoryList")
    public ResultEntity<List<Category>> getCategoryList() {
        List<Category> categoryList = categoryService.selectAll();
        return ResultEntity.successWithoutData(categoryList);
    }

}